<template>
  <a-card>
    <a-form :form="form" class="form">
      <a-row :gutter="16">
        <a-col :lg="12" :md="12" :sm="24">
          <a-form-item label="导师编号"
                       :labelCol="{span: 6,offset: 1}"
                       :wrapperCol="{span: 16, offset: 1}">
            <a-input  v-decorator="['dsbh']" disabled/>
          </a-form-item>
        </a-col>
        <a-col :lg="12" :md="12" :sm="24">
          <a-form-item label="导师姓名"
                       :labelCol="{span: 6,offset: 1}"
                       :wrapperCol="{span: 16, offset: 1}">
            <a-input v-decorator="['xm']" disabled/>
          </a-form-item>
        </a-col>
        <a-col :lg="12" :md="12" :sm="24">
          <a-form-item label="出生日期"
                       :labelCol="{span: 6,offset: 1}"
                       :wrapperCol="{span: 16, offset: 1}">
            <a-date-picker disabled v-decorator="['csrq']"/>
          </a-form-item>
        </a-col>
        <a-col :lg="12" :md="12" :sm="24">
          <a-form-item label="培养模式"
                       :labelCol="{span: 6,offset: 1}"
                       :wrapperCol="{span: 16, offset: 1}">
            <a-select disabled v-decorator="['pymsm']" allowClear>
              <a-select-option v-for="(i,index) in TYPE0347" :key="index" :value="i.code">{{ i.name }}</a-select-option>
            </a-select>
          </a-form-item>
        </a-col>
        <a-col :lg="12" :md="12" :sm="24">
          <a-form-item label="现任职务"
                       :labelCol="{span: 6,offset: 1}"
                       :wrapperCol="{span: 16, offset: 1}">
            <a-select v-decorator="['xrzw']" allowClear>
              <a-select-option v-for="(i,index) in TYPE0342" :key="index" :value="i.code">{{ i.name }}</a-select-option>
            </a-select>
          </a-form-item>
        </a-col>
        <a-col :lg="12" :md="12" :sm="24">
          <a-form-item label="门类"
                       :labelCol="{span: 6,offset: 1}"
                       :wrapperCol="{span: 16, offset: 1}">
            <a-select disabled v-decorator="['ml']" allowClear>
              <a-select-option v-for="(i,index) in TYPE0090" :key="index" :value="i.code">{{ i.name }}</a-select-option>
            </a-select>
          </a-form-item>
        </a-col>
        <a-col :lg="12" :md="12" :sm="24">
          <a-form-item label="一级学科"
                       :labelCol="{span: 6,offset: 1}"
                       :wrapperCol="{span: 16, offset: 1}">
            <a-select
              disabled
              v-decorator="['yjxkm']"
              placeholder="输入学科号或名称搜索"
              :filterOption="false"
              @search="fetchYjxk"
              showSearch
              :notFoundContent="yjxk.fetching ? undefined : null"
              allowClear
            >
              <a-spin v-if="yjxk.fetching" slot="notFoundContent" size="small"/>
              <a-select-option v-for="i in yjxk.list" :key="i.id" :value="i.xkdm">{{i.xkmc}}</a-select-option>
            </a-select>
          </a-form-item>
        </a-col>
        <a-col :lg="12" :md="12" :sm="24">
          <a-form-item label="获学士学位单位"
                       :labelCol="{span: 6,offset: 1}"
                       :wrapperCol="{span: 16, offset: 1}">
            <a-select style="width:50%" v-decorator="['hxsxwdwszsf']" @change="e => handlePChange(e, '1' , 'hxsxwdwdm')" :allowClear="true" showSearch :filterOption="filterOption">
              <a-select-option v-for="i in selectMenu.province" :key="i.areaCode" :value="String(i.areaCode)">{{ i.name }}</a-select-option>
            </a-select>
            <a-select style="width:50%"  v-decorator="['hxsxwdwdm']" :allowClear="true"  showSearch :filterOption="filterOption">
              <a-select-option v-for="i in selectMenu.schoolList1" :key="i.id" :value="String(i.xxmc)">{{ i.xxmc }}</a-select-option>
            </a-select>
          </a-form-item>
        </a-col>
        <a-col :lg="12" :md="12" :sm="24">
          <a-form-item label="获学士学位专业"
                       :labelCol="{span: 6,offset: 1}"
                       :wrapperCol="{span: 16, offset: 1}">
            <a-select
              v-decorator="['hxsxwzydm']"
              placeholder="输入专业号或名称搜索"
              :filterOption="false"
              @search="fetchXsxwzy"
              showSearch
              :notFoundContent="xsxwzy.fetching ? undefined : null"
              allowClear
            >
              <a-spin v-if="xsxwzy.fetching" slot="notFoundContent" size="small"/>
              <a-select-option v-for="i in xsxwzy.list" :key="i.id" :name="i.name" :value="i.code">{{i.name}}</a-select-option>
            </a-select>
          </a-form-item>
        </a-col>
        <a-col :lg="12" :md="12" :sm="24">
          <a-form-item label="获学士学位年月"
                       :labelCol="{span: 6,offset: 1}"
                       :wrapperCol="{span: 16, offset: 1}">
            <a-month-picker v-decorator="['hxsxwny']" style="width: 100%" format="YYYY-MM"/>
          </a-form-item>
        </a-col>
        <a-col :lg="12" :md="12" :sm="24">
          <a-form-item label="获学士学位证书编号"
                       :labelCol="{span: 6,offset: 1}"
                       :wrapperCol="{span: 16, offset: 1}">
            <a-input v-decorator="['xsxwzsbh']" placeholder="请输入学士学位证书编号" />
          </a-form-item>
        </a-col>
        <a-col :lg="12" :md="12" :sm="24">
          <a-form-item label="本科毕业单位"
                       :labelCol="{span: 6,offset: 1}"
                       :wrapperCol="{span: 16, offset: 1}">
            <a-select style="width:50%" v-decorator="['bkbydwszsf']" @change="e => handlePChange(e, '2' , 'bkbyxxdm')" :allowClear="true" showSearch :filterOption="filterOption">
              <a-select-option v-for="i in selectMenu.province" :key="i.areaCode" :value="String(i.areaCode)">{{ i.name }}</a-select-option>
            </a-select>
            <a-select style="width:50%"  v-decorator="['bkbyxxdm']" :allowClear="true"  showSearch :filterOption="filterOption">
              <a-select-option v-for="i in selectMenu.schoolList2" :key="i.id" :value="String(i.xxmc)">{{ i.xxmc }}</a-select-option>
            </a-select>
          </a-form-item>
        </a-col>
        <a-col :lg="12" :md="12" :sm="24">
          <a-form-item label="本科毕业专业"
                       :labelCol="{span: 6,offset: 1}"
                       :wrapperCol="{span: 16, offset: 1}">
            <a-select
              v-decorator="['bkbyzym']"
              placeholder="输入专业号或名称搜索"
              :filterOption="false"
              @search="fetchBkbyzy"
              showSearch
              :notFoundContent="bkbyzy.fetching ? undefined : null"
              allowClear
            >
              <a-spin v-if="bkbyzy.fetching" slot="notFoundContent" size="small"/>
              <a-select-option v-for="i in bkbyzy.list" :key="i.id" :name="i.name" :value="i.code">{{i.name}}</a-select-option>
            </a-select>
          </a-form-item>
        </a-col>
        <a-col :lg="12" :md="12" :sm="24">
          <a-form-item label="本科毕业年月"
                       :labelCol="{span: 6,offset: 1}"
                       :wrapperCol="{span: 16, offset: 1}">
            <a-month-picker v-decorator="['bkbyny']" style="width: 100%" format="YYYY-MM"/>
          </a-form-item>
        </a-col>
        <a-col :lg="12" :md="12" :sm="24">
          <a-form-item label="本科毕业证书编号"
                       :labelCol="{span: 6,offset: 1}"
                       :wrapperCol="{span: 16, offset: 1}">
            <a-input v-decorator="['bkbyzsbh']" placeholder="请输入本科毕业证书编号" />
          </a-form-item>
        </a-col>
        <a-col :lg="12" :md="12" :sm="24">
          <a-form-item label="获得本科证书学习形式"
                       :labelCol="{span: 6,offset: 1}"
                       :wrapperCol="{span: 16, offset: 1}">
            <a-select v-decorator="['hbkzsxxxsm']" allowClear>
              <a-select-option v-for="(i,index) in TYPE0388" :key="index" :value="i.code">{{ i.name }}</a-select-option>
            </a-select>
          </a-form-item>
        </a-col>
        <a-col :lg="12" :md="12" :sm="24">
          <a-form-item label="获硕士学位单位"
                       :labelCol="{span: 6,offset: 1}"
                       :wrapperCol="{span: 16, offset: 1}">
            <a-select style="width:50%" v-decorator="['hssxwdwszsf']" @change="e => handlePChange(e, '3' , 'hssxwdwdm')" :allowClear="true" showSearch :filterOption="filterOption">
              <a-select-option v-for="i in selectMenu.province" :key="i.areaCode" :value="String(i.areaCode)">{{ i.name }}</a-select-option>
            </a-select>
            <a-select style="width:50%"  v-decorator="['hssxwdwdm']" :allowClear="true"  showSearch :filterOption="filterOption">
              <a-select-option v-for="i in selectMenu.schoolList3" :key="i.id" :value="String(i.xxmc)">{{ i.xxmc }}</a-select-option>
            </a-select>
          </a-form-item>
        </a-col>
        <a-col :lg="12" :md="12" :sm="24">
          <a-form-item label="获硕士学位专业"
                       :labelCol="{span: 6,offset: 1}"
                       :wrapperCol="{span: 16, offset: 1}">
            <a-select
              v-decorator="['hssxwzydm']"
              placeholder="输入专业号或名称搜索"
              :filterOption="false"
              @search="fetchSsxwzy"
              showSearch
              :notFoundContent="ssxwzy.fetching ? undefined : null"
              allowClear
            >
              <a-spin v-if="ssxwzy.fetching" slot="notFoundContent" size="small"/>
              <a-select-option v-for="i in ssxwzy.list" :key="i.id" :name="i.name" :value="i.code">{{i.name}}</a-select-option>
            </a-select>
          </a-form-item>
        </a-col>
        <a-col :lg="12" :md="12" :sm="24">
          <a-form-item label="获硕士学位年月"
                       :labelCol="{span: 6,offset: 1}"
                       :wrapperCol="{span: 16, offset: 1}">
            <a-month-picker v-decorator="['hssxwny']" style="width: 100%" format="YYYY-MM"/>
          </a-form-item>
        </a-col>
        <a-col :lg="12" :md="12" :sm="24">
          <a-form-item label="硕士学位证书编号"
                       :labelCol="{span: 6,offset: 1}"
                       :wrapperCol="{span: 16, offset: 1}">
            <a-input v-decorator="['ssxwzsbh']" placeholder="请输入硕士学位证书编号" />
          </a-form-item>
        </a-col>
        <a-col :lg="12" :md="12" :sm="24">
          <a-form-item label="获硕士学位方式"
                       :labelCol="{span: 6,offset: 1}"
                       :wrapperCol="{span: 16, offset: 1}">
            <a-select v-decorator="['hssxwfsm']" allowClear>
              <a-select-option v-for="(i,index) in TYPE0408" :key="index" :value="i.code">{{ i.name }}</a-select-option>
            </a-select>
          </a-form-item>
        </a-col>
        <a-col :lg="12" :md="12" :sm="24">
          <a-form-item label="硕士毕业单位"
                       :labelCol="{span: 6,offset: 1}"
                       :wrapperCol="{span: 16, offset: 1}">
            <a-select style="width:50%" v-decorator="['ssbydwszsf']" @change="e => handlePChange(e, '4' , 'ssbyxxdm')" :allowClear="true" showSearch :filterOption="filterOption">
              <a-select-option v-for="i in selectMenu.province" :key="i.areaCode" :value="String(i.areaCode)">{{ i.name }}</a-select-option>
            </a-select>
            <a-select style="width:50%"  v-decorator="['ssbyxxdm']" :allowClear="true"  showSearch :filterOption="filterOption">
              <a-select-option v-for="i in selectMenu.schoolList4" :key="i.id" :value="String(i.xxmc)">{{ i.xxmc }}</a-select-option>
            </a-select>
          </a-form-item>
        </a-col>
        <a-col :lg="12" :md="12" :sm="24">
          <a-form-item label="硕士毕业专业"
                       :labelCol="{span: 6,offset: 1}"
                       :wrapperCol="{span: 16, offset: 1}">
            <a-select
              v-decorator="['ssbyzym']"
              placeholder="输入专业号或名称搜索"
              :filterOption="false"
              @search="fetchSsbyzy"
              showSearch
              :notFoundContent="ssbyzy.fetching ? undefined : null"
              allowClear
            >
              <a-spin v-if="ssbyzy.fetching" slot="notFoundContent" size="small"/>
              <a-select-option v-for="i in ssbyzy.list" :key="i.id" :name="i.name" :value="i.code">{{i.name}}</a-select-option>
            </a-select>
          </a-form-item>
        </a-col>
        <a-col :lg="12" :md="12" :sm="24">
          <a-form-item label="硕士毕业年月"
                       :labelCol="{span: 6,offset: 1}"
                       :wrapperCol="{span: 16, offset: 1}">
            <a-month-picker v-decorator="['ssbyny']" style="width: 100%" format="YYYY-MM"/>
          </a-form-item>
        </a-col>
        <a-col :lg="12" :md="12" :sm="24">
          <a-form-item label="硕士毕业证书编号"
                       :labelCol="{span: 6,offset: 1}"
                       :wrapperCol="{span: 16, offset: 1}">
            <a-input v-decorator="['ssbyzsbh']" placeholder="请输入硕士毕业证书编号" />
          </a-form-item>
        </a-col>
        <a-col :lg="12" :md="12" :sm="24">
          <a-form-item label="获博士学位单位"
                       :labelCol="{span: 6,offset: 1}"
                       :wrapperCol="{span: 16, offset: 1}">
            <a-select style="width:50%" v-decorator="['hbsxwdwszsf']" @change="e => handlePChange(e, '5' , 'hbsxwdwdm')" :allowClear="true" showSearch :filterOption="filterOption">
              <a-select-option v-for="i in selectMenu.province" :key="i.areaCode" :value="String(i.areaCode)">{{ i.name }}</a-select-option>
            </a-select>
            <a-select style="width:50%"  v-decorator="['hbsxwdwdm']" :allowClear="true"  showSearch :filterOption="filterOption">
              <a-select-option v-for="i in selectMenu.schoolList5" :key="i.id" :value="String(i.xxmc)">{{ i.xxmc }}</a-select-option>
            </a-select>
          </a-form-item>
        </a-col>
        <a-col :lg="12" :md="12" :sm="24">
          <a-form-item label="获博士学位专业"
                       :labelCol="{span: 6,offset: 1}"
                       :wrapperCol="{span: 16, offset: 1}">
            <a-select
              v-decorator="['hbsxwzydm']"
              placeholder="输入专业号或名称搜索"
              :filterOption="false"
              @search="fetchBsxwzy"
              showSearch
              :notFoundContent="bsxwzy.fetching ? undefined : null"
              allowClear
            >
              <a-spin v-if="bsxwzy.fetching" slot="notFoundContent" size="small"/>
              <a-select-option v-for="i in bsxwzy.list" :key="i.id" :name="i.name" :value="i.code">{{i.name}}</a-select-option>
            </a-select>
          </a-form-item>
        </a-col>
        <a-col :lg="12" :md="12" :sm="24">
          <a-form-item label="获博士学位年月"
                       :labelCol="{span: 6,offset: 1}"
                       :wrapperCol="{span: 16, offset: 1}">
            <a-month-picker v-decorator="['hbsxwny']" style="width: 100%" format="YYYY-MM"/>
          </a-form-item>
        </a-col>
        <a-col :lg="12" :md="12" :sm="24">
          <a-form-item label="博士学位证书编号"
                       :labelCol="{span: 6,offset: 1}"
                       :wrapperCol="{span: 16, offset: 1}">
            <a-input v-decorator="['bsxwzsbh']" placeholder="请输入博士学位证书编号" />
          </a-form-item>
        </a-col>
        <a-col :lg="12" :md="12" :sm="24">
          <a-form-item label="获博士学位方式"
                       :labelCol="{span: 6,offset: 1}"
                       :wrapperCol="{span: 16, offset: 1}">
            <a-select v-decorator="['hbsxwfsm']" allowClear>
              <a-select-option v-for="(i,index) in TYPE0408" :key="index" :value="i.code">{{ i.name }}</a-select-option>
            </a-select>
          </a-form-item>
        </a-col>
        <a-col :lg="12" :md="12" :sm="24">
          <a-form-item label="博士毕业单位"
                       :labelCol="{span: 6,offset: 1}"
                       :wrapperCol="{span: 16, offset: 1}">
            <a-select style="width:50%" v-decorator="['bsbydwszsf']" @change="e => handlePChange(e, '6' , 'bsbyxxdm')" :allowClear="true" showSearch :filterOption="filterOption">
              <a-select-option v-for="i in selectMenu.province" :key="i.areaCode" :value="String(i.areaCode)">{{ i.name }}</a-select-option>
            </a-select>
            <a-select style="width:50%"  v-decorator="['bsbyxxdm']" :allowClear="true"  showSearch :filterOption="filterOption">
              <a-select-option v-for="i in selectMenu.schoolList6" :key="i.id" :value="String(i.xxmc)">{{ i.xxmc }}</a-select-option>
            </a-select>
          </a-form-item>
        </a-col>
        <a-col :lg="12" :md="12" :sm="24">
          <a-form-item label="博士毕业专业"
                       :labelCol="{span: 6,offset: 1}"
                       :wrapperCol="{span: 16, offset: 1}">
<!--            <a-select  v-decorator="['bsbyzym']">
              <a-select-option v-for="i in selectMenu.bszy" :key="i.id" :value="i.zyh">{{ i.zyh}} {{ i.zymc }}</a-select-option>
            </a-select>-->
            <a-select
              v-decorator="['bsbyzym']"
              placeholder="输入专业号或名称搜索"
              :filterOption="false"
              @search="fetchBsbyzy"
              showSearch
              :notFoundContent="bsbyzy.fetching ? undefined : null"
              allowClear
            >
              <a-spin v-if="bsbyzy.fetching" slot="notFoundContent" size="small"/>
              <a-select-option v-for="i in bsbyzy.list" :key="i.id" :name="i.name" :value="i.code">{{i.name}}</a-select-option>
            </a-select>
          </a-form-item>
        </a-col>
        <a-col :lg="12" :md="12" :sm="24">
          <a-form-item label="博士毕业年月"
                       :labelCol="{span: 6,offset: 1}"
                       :wrapperCol="{span: 16, offset: 1}">
            <a-month-picker v-decorator="['bsbyny']" style="width: 100%" format="YYYY-MM"/>
          </a-form-item>
        </a-col>
        <a-col :lg="12" :md="12" :sm="24">
          <a-form-item label="博士毕业证书编号"
                       :labelCol="{span: 6,offset: 1}"
                       :wrapperCol="{span: 16, offset: 1}">
            <a-input v-decorator="['bsbyzsbh']" placeholder="请输入博士毕业证书编号" />
          </a-form-item>
        </a-col>
        <a-col :lg="12" :md="12" :sm="24">
          <a-form-item label="最后学位"
                       :labelCol="{span: 6,offset: 1}"
                       :wrapperCol="{span: 16, offset: 1}">
            <a-select v-decorator="['zhxwm']" allowClear>
              <a-select-option v-for="(i,index) in TYPE0023" :key="index" :value="i.code">{{ i.name }}</a-select-option>
            </a-select>
          </a-form-item>
        </a-col>
        <a-col :lg="12" :md="12" :sm="24">
          <a-form-item label="最后学历"
                       :labelCol="{span: 6,offset: 1}"
                       :wrapperCol="{span: 16, offset: 1}">
            <a-select v-decorator="['zhxlm']" allowClear>
              <a-select-option v-for="(i,index) in TYPE0018" :key="index" :value="i.code">{{ i.name }}</a-select-option>
            </a-select>
          </a-form-item>
        </a-col>
      </a-row>
    </a-form>
    <div class="ant-pro-footer-toolbar">
      <a-button style="float: right;margin-top: 10px;" @click="save" :loading="loadingBtn" type="primary">提交</a-button>
      <a-button style="float: right;margin: 10px 20px 0 0;" @click="back">关闭</a-button>
    </div>
  </a-card>
</template>

<script>
import { mapState } from 'vuex'
import { debounce } from 'utils/common'
const selectArr = ['TYPE0347', 'TYPE0342', 'TYPE0090', 'TYPE0388', 'TYPE0408', 'TYPE0409', 'TYPE0023', 'TYPE0018']
export default {
  data () {
    return {
      selectMenu: {},
      teacherInfo: {},
      loadingBtn: false,
      yjxk: { // 一级学科
        list: [],
        fetching: false
      },
      xsxwzy: { //
        list: [],
        fetching: false
      },
      bkbyzy: { //
        list: [],
        fetching: false
      },
      ssxwzy: { //
        list: [],
        fetching: false
      },
      ssbyzy: { //
        list: [],
        fetching: false
      },
      bsxwzy: { //
        list: [],
        fetching: false
      },
      bsbyzy: { //
        list: [],
        fetching: false
      },
    }
  },
  computed: {
    ...mapState({
      TYPE0347: state => state.app['TYPE0347'], // 培养模式
      TYPE0342: state => state.app['TYPE0342'], // 职务
      TYPE0090: state => state.app['TYPE0090'], // 门类
      TYPE0388: state => state.app['TYPE0388'], // 学习形式
      TYPE0408: state => state.app['TYPE0408'], // 获硕士学位方式
      TYPE0023: state => state.app['TYPE0023'], // 学位
      TYPE0018: state => state.app['TYPE0018'] // 学历
    })
  },
  beforeCreate () {
    this.form = this.$form.createForm(this)
  },
  created () {
    selectArr.forEach(v => {
      this.$store.dispatch('app/setDictionary', v)
    })
    this.initSelectMenu()
    this.$nextTick(() => {
      this.$api.teacher.teacherSupplementInfo({dsbh: this.$route.params.dsbh}).then(res => {
        this.teacherInfo = res.data

        if(this.teacherInfo.hxsxwdwszsf){
          this.handlePChange(this.teacherInfo.hxsxwdwszsf, '1' , 'hxsxwdwdm')
        }
        if(this.teacherInfo.bkbydwszsf){
          this.handlePChange(this.teacherInfo.bkbydwszsf, '2' , 'bkbyxxdm')
        }
        if(this.teacherInfo.hssxwdwszsf){
          this.handlePChange(this.teacherInfo.hssxwdwszsf, '3' , 'hssxwzydm')
        }
        if(this.teacherInfo.ssbydwszsf){
          this.handlePChange(this.teacherInfo.ssbydwszsf, '4' , 'ssbyxxdm')
        }
        if(this.teacherInfo.hbsxwdwdm){
          this.handlePChange(this.teacherInfo.hbsxwdwdm, '5' , 'hbsxwzydm')
        }
        if(this.teacherInfo.bsbydwszsf){
          this.handlePChange(this.teacherInfo.bsbydwszsf, '6' , 'bsbyxxdm')
        }
        if(this.teacherInfo.yjxkm){
          this.fetchYjxk(this.teacherInfo.yjxkm)
        }

        if(this.teacherInfo.hxsxwzydm){
          this.fetchXsxwzy(this.teacherInfo.hxsxwzydm)
        }
        if(this.teacherInfo.bkbyzym){
          this.fetchBkbyzy(this.teacherInfo.bkbyzym)
        }
        if(this.teacherInfo.hssxwzydm){
          this.fetchSsxwzy(this.teacherInfo.hssxwzydm)
        }
        if(this.teacherInfo.ssbyzym){
          this.fetchSsbyzy(this.teacherInfo.ssbyzym)
        }
        if(this.teacherInfo.hbsxwzydm){
          this.fetchBsxwzy(this.teacherInfo.hbsxwzydm)
        }
        if(this.teacherInfo.bsbyzym){
          this.fetchBsbyzy(this.teacherInfo.bsbyzym)
        }

        this.form.setFieldsValue(res.data)
      })
    })
    // subjectAll
  },
  methods: {
    filterOption (value, op) {
      return op.componentOptions.children[0].text.indexOf(value) !== -1
    },
    initSelectMenu () {
      let allRequest = [
        this.$api.base.areaList()
      ]
      Promise.all(allRequest).then(res => {
        this.selectMenu = {
          province: res[0].data
        }
      })
    },
    fetchYjxk: debounce(async function (value) {
      if(value && value.length > 1){
        this.yjxk.fetching = true
        let { data } = await this.$api.base.subjectAll({

          nameOrCode: value
        })
        this.yjxk.list = data
        this.yjxk.fetching = false
      }
    }),
    handlePChange(v, i, k) {
      this.form.setFieldsValue({k: ''})
      this.$api.base.schoolInfoQueryAll({xzqhsdm: v}).then(res => {
        this.$set(this.selectMenu, `schoolList${i}` , res.data)
      })
    },
    fetchXsxwzy: debounce(async function (value) {
      if(value && value.length > 1){
        this.xsxwzy.fetching = true
        let { data } = await this.$api.dict.queryAll({
          typeCode: 'TYPE0010',
          nameOrCode: value
        })
        this.xsxwzy.list = data
        this.xsxwzy.fetching = false
      }
    }),
    fetchBkbyzy: debounce(async function (value) {
      if(value && value.length > 1){
        this.bkbyzy.fetching = true
        let { data } = await this.$api.dict.queryAll({
          typeCode: 'TYPE0010',
          nameOrCode: value
        })
        this.bkbyzy.list = data
        this.bkbyzy.fetching = false
      }
    }),
    fetchSsxwzy: debounce(async function (value) {
      if(value && value.length > 1){
        this.ssxwzy.fetching = true
        let { data } = await this.$api.dict.queryAll({
          typeCode: 'TYPE0010',
          nameOrCode: value
        })
        this.ssxwzy.list = data
        this.ssxwzy.fetching = false
      }
    }),
    fetchSsbyzy: debounce(async function (value) {
      if(value && value.length > 1){
        this.ssbyzy.fetching = true
        let { data } = await this.$api.dict.queryAll({
          typeCode: 'TYPE0010',
          nameOrCode: value
        })
        this.ssbyzy.list = data
        this.ssbyzy.fetching = false
      }
    }),
    fetchBsxwzy: debounce(async function (value) {
      if(value && value.length > 1){
        this.bsxwzy.fetching = true
        let { data } = await this.$api.dict.queryAll({
          typeCode: 'TYPE0010',
          nameOrCode: value
        })
        this.bsxwzy.list = data
        this.bsxwzy.fetching = false
      }
    }),
    fetchBsbyzy: debounce(async function (value) {
      if(value && value.length > 1){
        this.bsbyzy.fetching = true
        let { data } = await this.$api.dict.queryAll({
          typeCode: 'TYPE0010',
          nameOrCode: value
        })
        this.bsbyzy.list = data
        this.bsbyzy.fetching = false
      }
    }),
    save () {
      this.loadingBtn = true
      let paramms = Object.assign({dsxxId: this.teacherInfo.dsxxId, dsbh: this.teacherInfo.dsbh}, this.form.getFieldsValue())
      this.$DateToString(paramms)
      this.$api.teacher.teacherSupplement(paramms).then(res => {
        this.$router.back()
        this.$message.success(res.msg)
      }).finally(() => {
        this.loadingBtn = false
        this.form.resetFields()
      })
    },
    back () {
      this.$router.back()
    }
  }
}
</script>

<style scoped lang="less">
.form{
  padding: 24px;
}
</style>
